package com.konne.nightmare.FastPublicOpinion.ui.information.fragment;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;

import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpFragment;
import com.konne.nightmare.FastPublicOpinion.bean.HomeBean;
import com.konne.nightmare.FastPublicOpinion.bean.MessageEvent;
import com.konne.nightmare.FastPublicOpinion.http.BaseResponse;
import com.konne.nightmare.FastPublicOpinion.bean.OpinionDataBean;
import com.konne.nightmare.FastPublicOpinion.mvp.presenter.HomePresenter;
import com.konne.nightmare.FastPublicOpinion.mvp.view.IHomeFragmentView;
import com.konne.nightmare.FastPublicOpinion.utils.LoadProgressDialog;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import java.util.List;


public class OpinionFragment extends BaseMvpFragment<IHomeFragmentView, HomePresenter> implements IHomeFragmentView, View.OnClickListener {


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EventBus.getDefault().register(this);
    }

    @Override
    public int getLayout() {
        return R.layout.opinion_fragment;
    }

    @Override
    public void initView() {


    }


    @Override
    public void initData(Bundle savedInstanceState) {
        handlerRefresh();
    }

    private void handlerRefresh() {

    }




    /**
     * 提供Fragment实例
     *
     * @return
     */
    public static OpinionFragment newInstance() {
        OpinionFragment fragment = new OpinionFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onRedPointStateChange(MessageEvent e) {
        if (null == e) {
            return;
        }

    }

    @Override
    public LoadProgressDialog getLoadDialog() {
        return dialog;
    }

    @Override
    public void cancelLoadDialog() {
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
    }


    @Override
    protected HomePresenter createPresenter() {
        return new HomePresenter();
    }

    @Override
    public void onClick(View v) {

    }

    @Override
    public void myWarning(BaseResponse<List<HomeBean.RowsBean>> data, boolean isUpRefresh) {

    }

    @Override
    public void postOpinionList(BaseResponse<List<OpinionDataBean.ResponseDataBean>> data, boolean isUpRefresh) {

    }

    @Override
    public void postOpinionDataStatistics(BaseResponse<OpinionDataBean.ResponseStatisticalDataBean> data) {

    }

    @Override
    public void postOpinionCWBD(BaseResponse<String> data) {

    }

    @Override
    public void notMoreData() {

    }

    @Override
    public void responseFailed(String failed) {

    }
}
